#include "csmsq.h"
#include <map>
using namespace std;

void CSmsq::put(int pid,int msqid)
{
    msqs[pid]=msqid;
}

int CSmsq::get(int pid)
{
    return msqs[pid];
}

int* CSmsq::getpids()
{
    int *pids=new int[msqs.size()];
    map<int,int>::const_iterator i_m;
    int i=0;
    for(i_m=msqs.begin();i_m!=msqs.end();i_m++)
    {
        pids[i++]=i_m->first;
    }
    return pids;
}

int CSmsq::size()
{
    return msqs.size();
}
